import { Controller, Get, Param } from '@nestjs/common';

import { type IPlatform } from '../interface.d';
import { ApiService } from './api.service';

@Controller('api')
export class ApiController {
  constructor(private readonly apiService: ApiService) {}

  /**
   * 登录接口
   *
   * @param folder 目录名 如：01
   * @param platform 平台名 如：xhs
   */
  @Get('open/:folder/:platform')
  open(@Param('folder') folder: string, @Param('platform') platform: IPlatform) {
    this.apiService.openBrowser(folder, platform);
    return '可以了';
  }
}
